<template>
  <div class="button-group">
      <slot></slot>
  </div>
</template>

<script>
export default {
  // 检测元素是否为div
  mounted () {
    for (const key of this.$el.children) {
      if (key.nodeName !== 'BUTTON') {
        console.warn('请插入button')
      }
    }
  }
}
</script>

<style scoped lang="scss">
.button-group {
    display: inline-flex;
    vertical-align: middle;
    > .z-button {
        border-radius: 0;
        &:not(:first-child) {
            margin-left: -1px;
        }
        &:first-child {
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
        }
        &:last-child {
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
        }
    }
}

</style>
